import React, { Component } from 'react'
import { Button ,Input } from 'antd'
import { connect } from 'react-redux'

class ReduxdomeOne extends Component {
    
    constructor(){
        super()
        this.state = {
            
        }
    }
    addCount =  ()=>{
        console.log('发送者',this.props);
        let action = { type:'1' }
        this.props.sendAction(action)
    }

    changeinpt = (e) => {
       
    }

    render() {
        return (
            <div>
                 <Input type="text"  onChange={ this.changeinpt } />
                <Button type='primary' onClick={this.addCount}>增加</Button>
            </div>
        )
    }
}
// 发送方
// 这个函数必须要有返回值，返回的是对象
const mapDispatchToProps = (dispatch) => {
    return {
        sendAction:(action)=>{
            dispatch(action)
        }
    }
}

export default connect(null,mapDispatchToProps)(ReduxdomeOne) 